A palettized image format is one in which color information is not directly stored by the pixels of an image data file. Instead, the pixels of the image data file correspond to an index in a color palette. This index, in turn, corresponds to a vector of channel values, wherein the vector defines a color in the color palette. Because more data bits typically are required to represent a vector of channel values than to represent a color palette index, a palette-based format typically reduces the memory space required for storing an image.
FIG. 1 illustrates how a pixel 100 of a pixel image 110, in palettized image format, is rendered on a display 120. As shown in FIG. 1, pixel image 110 includes a color palette 101 and a pixel buffer 102. Color palette 101 includes an index list 106 and an array of color channels 108. The value of pixel 100 in pixel buffer 102 corresponds to an index 104 of index list 106. Index 104, in turn, corresponds to a vector of color values 105. It is the vector of color values 105, rather than the value of pixel 100 in pixel buffer 102, that is used by display 120 to generate pixel 100.
One drawback of storing images in a palettized format is that it often results in a loss of color information. This loss of color information is due to the fact that only a limited number of colors are available in a typical color palette.
One known filtering technique for filtering palettized images, such as pixel image 110, is full-channel filtering. This technique involves filtering all of the color channels of the color palette and saving the output of the filtering process.
FIG. 2 is a schematic diagram that illustrates the full-channel filtering technique. As shown in FIG. 2, each pixel 100 of pixel buffer 102 is converted into a vector of color values, and filtered by filter 200 to form a second pixel buffer 210. Pixel buffer 210 can be displayed using display 120 (see FIG. 1). Pixel buffer 210 that results from full-channel filtering is no longer in palettized format. As a result, the memory footprint of an image filtered in accordance with the full-channel filtering technique is larger than the original unfiltered image. For example, applying full-channel filtering to an 8 bit/pixel palettized image can result in a filtered image that has 24 bits/pixel, in the case of 3 channels in the color palette (i.e., a filtered image that is approximately 3 times larger than the unfiltered image).
Another known filtering technique for filtering palettized images is the reverse palette lookup technique, which is illustrated in FIG. 3. This technique attempts to improve on the full-channel filtering technique by re-transforming pixel buffer 210 generated for each pixel of pixel buffer 102 into an index value again using color palette 302. According to this technique, the index values corresponding to the generated vectors of color values, rather than the vectors of color values, are stored in an image file 300. The reversal algorithm necessary for this technique, however, requires that each vector of color value corresponding to a pixel of pixel buffer 210 must be compared to the vectors of color values of a color palette 302 to find the closest approximation of a filtered color in color palette 302. Color palette 302 may or may not be the same as color palette 101. Thus, the reverse palette lookup technique is both computationally intense and time consuming. It also can result in a loss of color information due to the limited number of colors available in color palette 302, which must be used to represent the filtered vectors of color values.
What is needed therefore are filtering techniques for filtering palettized images that overcome the disadvantages described above.